package com.ym.medical.service.task;

import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;
import com.ym.core.rabbit.AbstractDelayedTask;
import com.ym.medical.domain.param.OrderParam;
import com.ym.medical.domain.param.OrderParam;
import com.ym.medical.service.IOrderPaySV;

/**
 * 自动退费订单任务
 *
 * @author: dai
 * @version: 2019年09月25日
 */
public class AutoRefundOrderTask extends AbstractDelayedTask {


	public AutoRefundOrderTask(String describe, long delayTime, JSONObject params) {
		super(describe, delayTime, params);
	}

	@Override
	public void run() {
		IOrderPaySV orderPaySV = SpringUtil.getBean(IOrderPaySV.class);
		JSONObject params = this.getParams();
		OrderParam orderModel = new OrderParam();
		orderModel.setOutTradeNo(params.getString("ioNum"));
		orderModel.setProductId(params.getString("id"));
		orderPaySV.refundOrder(orderModel);
	}
}
